import request from '../../utils/request.js'


// 获取资源列表
export const getResourceList = (data) => {
  return request({
    url: '/resource/list',
    method: 'post',
    data
  })
}



// 获取单个
export const getResource = (id) => {
  return request({
    url: `/resource/byId?id=${id}`,
    method: 'get'
  })
}


// 支付接口
export const pay = (id, email) => {
  return request({
    url: `/resource/pay?id=${id}&email=${email}`,
    method: 'post'
  })
}


// 获取所有類型
export const getAllType = () => {
  return request({
    url: '/restype/ResTypeList',
    method: 'get'
  })
}


// 免费资源下载地址
export const downloadRes = (id) => {
  return request({
    url: `/netDown?id=${id}`,
    method: 'post'
  })
}